package com.mcode.blog.controller;

import com.mcode.blog.service.LoginService;
import com.mcode.blog.vo.Result;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RequestMapping("logout")
@RestController
public class LogoutController {

    @Resource
    private LoginService loginService;

    /**
     * 退出
     * @param token
     * @return
     */
    @GetMapping
    public Result logout(@RequestHeader("Authorization") String token) {
        loginService.logout(token);
        return Result.success(null);
    }

}
